/**
 * 生成随机名称
 */

export function randomName() {
  const num = Math.random() * (9999 - 1000) + 1000;
  const time = new Date().getTime();
  return `${time}_${Math.ceil(num)}`;
}

/**
 * 获取文件后缀
 */
export function getExt(fileName: string) {
  const filePath = fileName;
  const index = filePath.lastIndexOf('.');
  const ext = filePath.substr(index + 1);
  return ext;
}
